package nl.jaapniek.model;

public class Veld {
	private String naam;
	private String type;
	private boolean notNull;
	private String tabelNaam;

	public Veld(String naam, String type, boolean notNull) {
		this.naam = naam;
		this.type = type;
		this.notNull = notNull;
	}

	public String getNaam() {
		return naam;
	}

	public void setNaam(String naam) {
		this.naam = naam;
	}

	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}

	public boolean isNotNull() {
		return notNull;
	}

	public void setNotNull(boolean notNull) {
		this.notNull = notNull;
	}
	
	public String getTabelNaam() {
		return tabelNaam;
	}

	public void setTabelNaam(String tabelNaam) {
		this.tabelNaam = tabelNaam;
	}
	
	public String toString(){
		return naam + "/" + type;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((naam == null) ? 0 : naam.hashCode());
		result = prime * result + (notNull ? 1231 : 1237);
		result = prime * result
				+ ((tabelNaam == null) ? 0 : tabelNaam.hashCode());
		result = prime * result + ((type == null) ? 0 : type.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Veld other = (Veld) obj;
		if (naam == null) {
			if (other.naam != null)
				return false;
		} else if (!naam.equals(other.naam))
			return false;
		if (notNull != other.notNull)
			return false;
		if (tabelNaam == null) {
			if (other.tabelNaam != null)
				return false;
		} else if (!tabelNaam.equals(other.tabelNaam))
			return false;
		if (type == null) {
			if (other.type != null)
				return false;
		} else if (!type.equals(other.type))
			return false;
		return true;
	}

}
